<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 全局乘客id 颁发器 ,一个证件号对应一个乘客id
        Schema::create('common_passengers', function (Blueprint $table) {
            $table->id();
            $table->string('passenger_id')->comment('乘客id');
            $table->string('identity_code')->comment('乘客证件号');
            $table->timestamps();
            $table->unique('passenger_id', 'unique_pid');
            $table->unique('identity_code', 'unique_idc');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('common_passengers');
    }
};
